import React, { Component } from 'react';
import querystring from 'querystring';
import './styles.less';


class GankArtcleDetail extends Component {
  // state = {
  //   data: null
  // };

  componentDidMount() {
  }

  render() {

    // if(!this.props.location.search){
    //   return false;
    // }

    const routerParams = querystring.parse( this.props.location.search.substr(1) );

    return (
      <div className="detail-wrap">
        <div className="return" onClick={()=>this.props.history.goBack()}>
          返回
        </div>
        <div className="content">
          id: {this.props.match.params.id} <br/>
          标题: {routerParams.desc} <br />
          url: <a href={routerParams.url} target="_blank">{routerParams.url}</a>
        </div>
        {/* <iframe height="100%" width="100%" src={routerParams.url} title={routerParams.title || '文章详情'} /> */}
      </div>
    );
  }
}

export default GankArtcleDetail;
